<?php
require_once 'duckBehavior/fly.php';
require_once 'duckBehavior/quck.php';
//鸭子类
class Duck {
    //名字
    public $name;
    protected $fly;
    protected $quck;

    //呱呱叫
    public function qucking()
    {
        if ($this->quck instanceof Quck)
        {
            return $this->quck->qucking();
        }
    }

    //飞
    public function flying()
    {
        if ($this->fly instanceof Fly)
        {
            return $this->fly->flying();
        }
    }
}